﻿using System;
using UnityEngine;
using Yoozoo.Mars.Got;

public class ModelQuality : MonoBehaviour
{
    public Renderer renderer;
    public Material lowMaterial;
    public Material highMaterial;
    private int currentDeviceQuality = -1;
    
    private void Awake()
    {
        var deviceQuality = (int)DeviceQuality.Instance.GetCurrentQuality();
        if (currentDeviceQuality == deviceQuality)
        {
            return;
        }
        if (deviceQuality <= 2)
        {
            renderer.sharedMaterial = lowMaterial;
        }
        else
        {
            renderer.sharedMaterial = highMaterial;
        }
        currentDeviceQuality = deviceQuality;
    }
}
